(function(global, doc){
    var _win = null
    sendBtn.onclick = function() {
        _win.postMessage(text.value, '*')
        text.value = ''
    }    

    openWindow.onclick = function() {
        _win = global.open('http://localhost:5500', '_blank')
    } 
    
    global.addEventListener('message', function(e) {
        msg.innerHTML = e.data
    })
}(this, document))